/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gmail.avereshchaga.models;

import com.gmail.avereshchaga.transport.Client;
import com.gmail.avereshchaga.transport.entity.Item;
import java.util.ArrayList;
import javax.swing.AbstractListModel;

/**
 *
 * @author <a href="mailto:avereshchaga@gmail.com">Vereshchaga Alexey</a>
 */
public class ItemsModel extends AbstractListModel {

    ArrayList<Item> items = (ArrayList<Item>) Client.getItems();

    @Override
    public int getSize() {
        return items.size();
    }

    @Override
    public Object getElementAt(int index) {
        return items.get(index).getName();
    }

    @Override
    public void fireContentsChanged(
            Object source, int index0, int index1) {
        super.fireContentsChanged(source, index0, index1);
    }
}
